package org.lightweightimageviewer.liv;

import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * Displayed at bottom of window. Relays information to user.
 * 
 * @author Steven Boscarine
 * 
 */
public class StatusBar extends JPanel {
	/** Name of file */
	private final JLabel fileName = new JLabel();
	/** Display position: n/totalFiles */
	private final JLabel position = new JLabel();
	/** Never changes */
	private final int totalFiles;

	public StatusBar(int totalFiles) {
		this.totalFiles = totalFiles;
		setLayout(new BorderLayout());
		add(fileName, BorderLayout.WEST);
		add(position, BorderLayout.EAST);
	}

	public void update(LiImage image) {
		fileName.setText(image.getFileName() + " ");
		position.setText(image.getPosition() + "/" + totalFiles);
	}

	private static final long serialVersionUID = 1L;
}